#include <iostream>

using namespace std;

int count[14];

int main() 
{
    
    for (int i = 0; i < 7; ++i) 
	{
        int a;
        cin >> a;
        count[a]++;
    }
    
    bool found = false;
    for (int x = 1; x <= 13; ++x) 
	{
        if (count[x] >= 3) 
		{
            for (int y = 1; y <= 13; ++y) 
			{
                if (x != y && count[y] >= 2)
				{
                    found = true;
                    break;
                }
            }
            if (found) break;
        }
    }
    
    if(found) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
